﻿@using System.Web.Mvc;
@{    
    Style.Require("FancyBox");
    Script.Require("FancyBox");
}
<div id="footer-menu">
    @if (WorkContext.CurrentUser == null) {
    <a class="footer-menu-item sign-in" href="javascript:;"><p></p>@T("Sign In")</a>
    } else {
    <a class="footer-menu-item settings" href="javascript:;"><p></p>@T("Settings")</a>
    }
    <a class="footer-menu-item contact" href="@Href("~/contact")"><p></p>@T("Contact")</a>
    <a class="footer-menu-item support" href="@Href("~/support")"><p></p>@T("Support")</a>
</div>   
<div id="settings-menu-container">
    <div id="settings-menu">
    @if (WorkContext.CurrentUser != null) {
            <div><a class="popup" href="#user-change-password">@T("Change Password")</a></div>
            <div>@Html.ActionLink(T("Sign Out").ToString(), "LogOff", new { Controller = "Account", Area = "Orchard.Users", ReturnUrl = Context.Request.RawUrl }, new { rel = "nofollow" })</div>
            <div style="display: none" id="user-change-password">
                @Display(New.ChangePassword())
            </div>
        if (AuthorizedFor(Orchard.Security.StandardPermissions.AccessAdminPanel)) {
            <div class="settings-menu-separator"></div>
            <div>@Html.ActionLink(T("Dashboard").ToString(), "Index", new { Area = "Dashboard", Controller = "Admin" })</div>
        }
    } else {
            <div><a class="popup" href="#user-log-on">@T("Sign In")</a></div>
            <div><a class="popup" href="#user-register">@T("Register")</a></div>
            <div style="display: none; height: auto;" id="user-log-on">
                @Display(New.LogOn())
            </div>
            <div style="display: none; height: auto;" id="user-register">
                @Display(New.Register())
            </div>
    }
    </div>
    <div class="callout"></div>
</div>
<div style="display: none">
    <a id="popupHack"></a>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $(".popup").fancybox({
            padding: 0,
            autoSize: true
        });
    });
</script>